﻿Imports System.IO

Namespace Models
    Public Class ModuleExec
        Dim x As New List(Of String)
        Dim m As New ADODBU.RowClassList(Of clsZModuleScriptRow)
        Sub New(ByVal Mod_id As String)

            m.Clear()
            If Dir(AppDomain.CurrentDomain.BaseDirectory & "Models\" & Mod_id & "JsList.txt") <> "" Then
                Dim sr As StreamReader = New StreamReader(AppDomain.CurrentDomain.BaseDirectory & "Models\" & Mod_id & "JsList.txt")
                Dim cdata As String
                Dim ss As clsZModuleScriptRow
                Do While sr.Peek() >= 0
                    cdata = sr.ReadLine()
                    ss = New clsZModuleScriptRow
                    ss.Script = cdata
                    m.Add(ss)
                Loop
                sr.Close()
            End If

        End Sub

        Public Property ListJS() As IEnumerable(Of clsZModuleScriptRow)
            Get
                Return m
            End Get
            Set(ByVal value As IEnumerable(Of clsZModuleScriptRow))
                m = value
            End Set
        End Property

    End Class
End Namespace
